package xhwl.hmo.mall.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.hmo.mall.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by Administrator on 2017/9/5.
 */

public class RecommendApi extends BaseApi {
    HmoNewsReq req;

    public RecommendApi(int page_num) {
        req = new HmoNewsReq(page_num);
    }


    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).recommend(requestBody);
    }

    private class HmoNewsReq {
        int page_num;
        public HmoNewsReq(int page_num) {
            this.page_num=page_num;

        }
    }
}
